{% extends "base.html" %}
{% load i18n plmapp_tags %}
<!-- Manage html display in the Content div which correspond to the "revisions" menu -->

{% block css %}
    <style type="text/css">
        div.identity_card.ic-current {
            box-shadow: 3px 3px 9px #C90657;
        }
    </style>
{% endblock %}
{% block content %}
    {% if add_revision_form and obj.is_revisable and is_contributor %}
        <form id="form-revision" method="POST"
            class= "inline-form {% if confirmation %}confirmation{% endif %}" action="">
            {% csrf_token %}
            {{ add_revision_form }}

            {% if confirmation %}
                {% block confirmation %} {% endblock %}
            {% endif %}

            <input type="submit" class="tb-btn tb-btn-large tb-btn-success" value="{% trans "NEW" %}"/>
        </form>
    {% else %}
        {% if not is_contributor %}
            {% trans "You can not revise this object since you are not a contributor." %}
        {% elif is_readable %}

            {% if obj.is_cancelled %}
                {% trans "You can not revise this object since it is cancelled." %}
            {% elif obj.is_deprecated %}
                {% trans "You can not revise this object since it is deprecated." %}
            {% else %}
                {% trans "You can not revise this object since a revision already exist." %}
            {% endif %}

        {% endif %}
    {% endif %}
    <div id="rev_list" class="Content">
        {% with obj.is_part|yesno:"parts,documents"|add:"/identity_card.html" as path %}
            {% for object in revisions %}
                {% if obj.revision == object.revision %}
                    {% include path with type="current"%}
                {% else %}
                    {% include path %}
                {% endif %}
            {% endfor %}
        {% endwith %}
    </div>
{% endblock %}

